/*
 * @Description:
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2022-08-30 16:53:40
 * @LastEditors: wiz
 * @LastEditTime: 2024-07-26 09:02:39
 */
import { Tsrv } from '@/services';
import Vue from 'vue';
import Router from 'vue-router';

const LoginPage: any = () =>
  import(/* webpackChunkName: "login-page" */ '../views/login/index.vue');
const HomePage: any = () =>
  import(/* webpackChunkName: "root-page" */ '../views/home/index.vue');
const page404: any = () =>
  import(/* webpackChunkName: "error-page" */ '../views/error/404.vue');
const appPage: any = () =>
  import(/* webpackChunkName: "error-page" */ '../views/app/index.vue');
const TestPage: any = () =>
  import(/* webpackChunkName: "error-page" */ '../views/test1/index.vue');

Vue.use(Router);

const routes: {
  path: string;
  name: string;
  component: Vue;
}[] = [
  {
    path: Tsrv.lexicon.routerPath.home.path,
    name: Tsrv.lexicon.routerPath.home.name,
    component: HomePage
  },
  {
    path: Tsrv.lexicon.routerPath.login.path,
    name: Tsrv.lexicon.routerPath.login.name,
    component: LoginPage
  },

  {
    path: Tsrv.lexicon.routerPath.singleSign.path,
    name: Tsrv.lexicon.routerPath.singleSign.name,
    component: appPage
  },
  {
    path: Tsrv.lexicon.routerPath.test.path,
    name: Tsrv.lexicon.routerPath.test.name,
    component: TestPage
  },

  {
    path: '*',
    name: Tsrv.lexicon.routerPath.page404.name,
    component: page404
  }
];

export default new Router({ routes, mode: 'history' });
